<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/vue/2.4.2/vue.js"></script>
</head>
<body>
    <div id="app">
        <p v-if='seen'>现在你可以看见我了</p>
        <template v-if='ok'>
        <h1>只有这么帅气</h1>
        </template>
        <p><a v-bind:href='url'>提交到百度</a></p><br/>
        <hr>
        <h1>指令修饰符</h1>
        <form @submit.prevent='prevent' :action="url"> 
            <button type="submit">提交</button>
        </form>
    </div>
    <script >
    var vm=new Vue({
        el:'#app',
        data:{
            seen:true,
            ok:true,
            url:"http://www.baidu.com"
        },
        methods:{
            action(){
                alert('正在提交表单')
            },
            prevent(){
                alert('阻止了默认行为')
            },
        },
        
    });
    </script>
</body>
</html>  